#include "connection.h"

Connection::Connection(  ) 
{
	http = new QHttp(this);
}

QString Connection::getUserName( ) const
{
	return _userName;
}

QString Connection::getPassWord( ) const
{
	return _passWord;
}

QString Connection::getApiBaseUrl( ) const
{
	return _apiBaseUrl; 
}

void Connection::setUserName( QString userName )
{
	_userName = userName;
}

void Connection::setPassWord( QString passWord )
{
	_passWord = passWord;
}

void Connection::setApiBaseUrl( QString apiBaseUrl )
{
	_apiBaseUrl = apiBaseUrl;
}

void Connection::getRawRequest( QString relativeUrl )
{
	
	QUrl url( relativeUrl );
	
    http->setHost(url.host());
    
    //Authentication
    if ( _userName != "" && _passWord != "" )
        http->setUser( _userName, _passWord );

    //connectionId = http->get()(url.path());
}
